home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / MW MPW Binaries 1.1.1a2 / mwcPPC / MWCIncludes / istream < prev    next >
Encoding:
Text File  |  1994-07-18  |  2.6 KB  |  97 lines  |  [TEXT/MMCC]

  1. // istream standard header
  2. #ifndef _ISTREAM_
  3. #define _ISTREAM_
  4. #include <streambuf>
  5.  
  6. #if __MWERKS__
  7. #pragma options align=mac68k
  8. #endif
  9.  
  10.         // class istream
  11. class istream : virtual public ios {
  12. public:
  13.     istream(streambuf *_S)
  14.         : _Chcount(0), ios(_S) {}
  15.     istream(_Uninitialized)
  16.         : ios(_Noinit) {}
  17.     virtual ~istream();
  18.     _Bool ipfx(int = 0);
  19.     void isfx()
  20.         {}
  21.     istream& operator>>(istream& (*_F)(istream&))
  22.         {return ((*_F)(*this)); }
  23.     istream& operator>>(ios& (*_F)(ios&))
  24.         {(*_F)(*(ios *)this); return (*this); }
  25.     istream& operator>>(char *);
  26.     istream& operator>>(unsigned char *_S)
  27.         {return (*this >> (char *)_S); }
  28.     istream& operator>>(char&);
  29.     istream& operator>>(unsigned char& _C)
  30.         {return (*this >> *(char *)&_C); }
  31.     istream& operator>>(short&);
  32.     istream& operator>>(unsigned short&);
  33.     istream& operator>>(int&);
  34.     istream& operator>>(unsigned int&);
  35.     istream& operator>>(long&);
  36.     istream& operator>>(unsigned long&);
  37.     istream& operator>>(float&);
  38.     istream& operator>>(double&);
  39.     istream& operator>>(long double&);
  40.     istream& operator>>(void *&);
  41.     istream& operator>>(streambuf&);
  42.     int get();
  43.     istream& get(char *, int, char = '\n');
  44.     istream& get(unsigned char *_S, int _N, char _D = '\n')
  45.         {return(get((char *)_S, _N, _D)); }
  46.     istream& get(char&);
  47.     istream& get(unsigned char& _C)
  48.         {return (get((char&)_C)); }
  49.     istream& get(streambuf&, char = '\n');
  50.     istream& getline(char *, int, char = '\n');
  51.     istream& getline(unsigned char *_S, int _N, char _D = '\n')
  52.         {return(getline((char *)_S, _N, _D)); }
  53.     istream& ignore(int = 1, int = EOF);
  54.     istream& read(char *, int);
  55.     istream& read(unsigned char *_S, int _N)
  56.         {return(read((char *)_S, _N)); }
  57.     int peek();
  58.     istream& putback(char);
  59.     istream& unget();
  60.     int gcount() const
  61.         {return (_Chcount); }
  62.     int sync();
  63. #if _SIGNED_CHAR_IS_DISTINCT
  64.     istream& operator>>(signed char *_S)
  65.         {return (*this >> (char *)_S); }
  66.     istream& operator>>(signed char& _C)
  67.         {return (*this >> *(char *)&_C); }
  68.     istream& get(signed char *_S, int _N, char _D = '\n')
  69.         {return (get((char *)_S, _N, _D)); }
  70.     istream& get(signed char& _C)
  71.         {return (get((char&)_C)); }
  72.     istream& getline(signed char *_S, int _N, char _D = '\n')
  73.         {return (getline((char *)_S, _N, _D)); }
  74.     istream& read(signed char *_S, int _N)
  75.         {return (read((char *)_S, _N)); }
  76. #endif /* _SIGNED_CHAR_IS_DISTINCT */
  77. protected:
  78.     int _Getffld(char [_MAX_EXP_DIG+_MAX_SIG_DIG+16]);
  79.     int _Getifld(char [_MAX_INT_DIG]);
  80. private:
  81.     int _Chcount;
  82.     };
  83.         // manipulators
  84. istream& ws(istream&);
  85.  
  86. #if __MWERKS__
  87. #pragma options align=reset
  88. #endif
  89.  
  90. #endif
  91.  
  92. /*
  93.  * Copyright (c) 1994 by P.J. Plauger.  ALL RIGHTS RESERVED. 
  94.  * Consult your license regarding permissions and restrictions.
  95.  */
  96.  
  97.